<?php
require_once 'includes/haut.php';
acces($niveau,1);

require_once 'modules/gestionMateriel.php';
require_once 'includes/donneesFormulaires.php';

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>Gestion du mat&eacute;riel</title>
		<?php include('includes/headLinks.php');?>
		<script type="text/javascript" src="js/formMateriel.js"></script>
	</head>
	<body>
		<div id="entete">
			<?php include('includes/entete.php'); ?>
		</div>

		<div id="navigation">
			<?php include('includes/navigation.php'); ?>
		</div>

		<div id="principal">
		
		<?php if (!isset($_GET['activite']) && !isset($activite)) {
				header("Location:indexAdmin.php");
				exit();	
			}
			else if (isset($_GET['activite'])){
				$activite = $_GET['activite'];
			}
		?>

			<form action="formMateriel.php" method="post">
				
				<h2>Ajouter un nouveau mat&eacute;riel</br><?php echo $activite;?></h2>

				<div class="error">
					<?php
					if(isset($materiel))
						echo $erreursMat;
					else
						$materiel = new materiel();
					if(isset($categorie))
						echo $erreursCat;
					else
						$categorie = new categorie();
		
					?>
				</div>
				
				<p><input type="hidden" name="activite" value="<?php echo $activite;?>" /></p>
				<table>
<!-- 					<tr>						 -->
<!-- 						<td><label for="activite">Activit&eacute; : </label></td> -->
<!-- 						<td><select name="activite" id="activite"> -->
<!-- 								<option value="">S&eacute;lectionnez une activit&eacute;</option> -->
<!-- 								<option value="alpin">Ski alpin</option> -->
<!-- 								<option value="snow">Snowboard</option> -->
<!-- 								<option value="fond">Ski de fond</option> -->
<!-- 							</select> -->
<!-- 						</td> -->
<!-- 					</tr> -->
					<tr>
						<td><label for="type">Type : </label></td>
						<td><select name="type" id="type" style="width: 100%">
								<option value="">S&eacute;lectionnez un type</option>
								<?php selectType($tabType[$activite], $categorie->getType());?>
							</select>
						</td>
					</tr>
					<tr>
						<td><label for="niveau">Niveau : </label></td>
						<td><select name="niveau" id="niveau" style="width: 100%">
								<option value="">S&eacute;lectionnez un niveau</option>
								<?php selectType($tabNiveau[$activite], $categorie->getNiveau());?>
							</select>
						</td>
					</tr>
					<tr>
						<td><label for="marque">Marque : </label></td>
						<td><select name="marque" id="marque" style="width: 100%">
								<option value="">S&eacute;lectionnez une marque</option>
						</select>
						</td>
					</tr>
					<tr>
						<td><label for="modele">Mod&egrave;le : </label></td>
						<td><input type="text" name="modele" id="modele" maxlength="30" style="width: 97%"
							value="<?php echo $materiel->getModele() ;?>" /></td>
					</tr>
					<tr>
						<td><label for="taille">Taille/Pointure : </label></td>
						<td><input type="text" name="taille" id="taille" maxlength="4" style="width: 97%"
							value="<?php echo $materiel->getTaille() ;?>" /></td>
					</tr>
				</table>

				<p>
					<center> <input type="submit" name="envoyer" value="Envoyer" />
					&nbsp;&nbsp;&nbsp;&nbsp; <input type="reset" name="reset"
						value="R&eacute;initialiser" /> </center>
				</p>
				<p>
					<input type="hidden" name="action" value="ajouter" />
				</p>
			</form>
		</div>

		<div id="publicite">
			<?php include('includes/publicite.php'); ?>
		</div>
	</body>
</html>